package cn.wind.xboot.logic.pf.service.impl;

import cn.wind.xboot.logic.pf.dao.PfNoticeMapper;
import cn.wind.xboot.logic.pf.entity.PfNotice;
import cn.wind.xboot.logic.pf.service.IPfNoticeService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.sql.SqlHelper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 平台通知 服务实现类
 * </p>
 *
 * @author xukk
 * @since 2018-08-20
 */
@Service
public class PfNoticeServiceImpl extends ServiceImpl<PfNoticeMapper, PfNotice> implements IPfNoticeService {

    @Override
    public boolean updateReadFlagById(Long id) {
        return SqlHelper.delBool(this.baseMapper.updateReadFlagById(id));
    }

    @Override
    public boolean updateReadFlagByIds(List ids) {
        return SqlHelper.delBool(this.baseMapper.updateReadFlagByIds(ids));
    }

    @Override
    public boolean softDelete(List ids) {
        return SqlHelper.delBool(this.baseMapper.softDelete(ids));
    }

    @Override
    public IPage<PfNotice> findByDeleteFlag(IPage page, Integer deleteFlag) {
        return page.setRecords(this.baseMapper.findByDeleteFlag(deleteFlag));
    }

    @Override
    public Integer countByDeleteFlag(Integer deleteFlag) {
        return this.baseMapper.countByDeleteFlag(deleteFlag);
    }

    @Override
    public boolean resume(List ids) {
        return SqlHelper.delBool(this.baseMapper.resume(ids));
    }
}
